################################################################################
#  ETFAna project, Anyang Normal University && IMP-CAS
#  \brief for building base classes and structs for ETFAna
#  \note that all the cxx files of the classes are automatically added by macro
#  config_lib(). Don't put any unwanted files with suffix ".cxx" in this folder
#  or its subfolders. If new classes are added, please rerun cmake to include them
#  \author SUN Yazhou, asia.rabbit@163.com
#  \since 2021-10-06
#  \date 2021-11-23 last modified
#  \attention
#  changelog
#  <table>
#  <tr>  <th>Date         <th>Author      <th>Description                  </tr>
#  <tr>  <td>2021-10-06   <td>Asia Sun    <td>file created                 </tr>
#  </table>
#  \copyright Copyright (c) 2021-2024 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
################################################################################

set(target ETFBase)
file(GLOB_RECURSE LIBSRCS *.cxx)
add_library(${target} SHARED ${LIBSRCS})
set(subdirs config data det gui hit online pid run source task tools track unpack vis)
foreach(dir ${subdirs})
  target_include_directories(${target} PUBLIC ${dir})
endforeach()

# register the relevant classes to root-dictionary
etf_change_ext(.cxx .h FILES "${LIBSRCS}" OUTVAR headers)
etf_rootGen(${target} HEADERS ${headers} LINKDEF BaseLinkDef.h)

# add config.h to allow cmake to configure the source code
# for addition of optional 3rd-party libraries
configure_file(
  ${PROJECT_SOURCE_DIR}/cmake/scripts/config.h.in
  ${CMAKE_CURRENT_SOURCE_DIR}/tools/config.h
)
